import {createRouter,createWebHashHistory} from 'vue-router'

const Login = () => import("../views/Login.vue")
const Index =() =>import("../views/user-center/Index.vue")
const Profile =() =>import("../views/user-center/Profile.vue")
const Setting =() =>import("../views/user-center/Setting.vue")

const routeConfig =[
    {path:'/',redirect:'/login'},
    {path:'/login',name:'login',component:Login},
        
    {
        path:'/user-center',
        name:'usercenter',
        component:Index,
        redirect:'/user-center/profile',
        children:[
            {
                path:"profile",
                name:"profile",
                component:Profile
            },
            {
                path:"setting",
                name:"setting",
                component:Setting
            },
        ],
    },
]
const router = createRouter({
    history:createWebHashHistory(),
    routes:routeConfig
})



//对外暴露实例化路由
export default router